<template>
  <div class="number-allocation">
    <div class="header">
      <el-button type="info" style="background-color: #6e767c" @click="router.push('/nav')">回主页</el-button>
    </div>
    <h2>靓号市场</h2>
    <div style="font-size: 18px; color: #000">总数：{{tableData.length}}</div>
    <div style="padding: 0 12px; margin-top: 12px">
      <el-table
          class="my-table"
          :data="tableData"
          style="width: 100%"
      >
        <el-table-column label="生肖" property="billType" width="60">
          <template #default="scope">{{ scope.row.billType === 0 ? '龙钞' : '蛇钞' }}</template>
        </el-table-column>
        <el-table-column property="serialNumber" label="冠字号"/>
        <el-table-column property="price" label="价格"/>
      </el-table>
    </div>
  </div>
</template>

<script setup>
import router from "@/router";
import {ref} from "vue";
import {getNiceCodes} from "@/api/api";
import {ElMessage} from "element-plus";
const tableData = ref([])

const getMyList = async () => {
  const res = await getNiceCodes()
  if (res.code !== 200) {
    return ElMessage.error({
      message: res.msg,
      type: 'error',
    });
  }
  tableData.value = res.rows
}

getMyList()
</script>

<style lang="less">
.number-allocation {
  height: 100%;

  .header {
    display: flex;
    padding: 12px;
    box-shadow: 0 10px 15px -5px rgba(0,0,0,0.12);
  }

  .detail_box {
    & > div {
      display: flex;
      font-size: 18px;
      color: #000;
      margin-bottom: 12px;

      .label {
        font-weight: bold;
      }
    }
  }

  .my-table {
    td .el-button > span {
      font-size: 13px !important;
    }

    .el-button--primary {
      background-color: #1677ff !important;
    }
  }

  .el-table th.el-table__cell {
    background-color: #1677ff !important;
    color: #ffffff !important;
  }

  .el-table__header-wrapper {
    border-radius: 8px 8px 0 0;
  }
}
</style>
